from django.db import models


class Mood(models.Model):
    name = models.CharField(verbose_name="心情", max_length=20)

    class Meta:
        db_table = 'talk_mood'
        verbose_name = "随说心情分类"
        verbose_name_plural = verbose_name


class Talk(models.Model):
    content = models.TextField()
    mood = models.ForeignKey(Mood, on_delete=models.DO_NOTHING, related_name="talks")
    is_del = models.BooleanField(default=False)
    pub_time = models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table = 'talk'
        verbose_name = "随说"
        verbose_name_plural = verbose_name
